package com.yilin.tms.core.entity.data.receipt;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.entity.order.transit.TransitOrderNoteDetail;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 电子回执单
 */
@Entity
@Table(name = "data_receipt_order")
@TableName("data_receipt_order")
public class ReceiptOrder extends BaseDataEntity {

    @Column(name = "transit_order_id")
    private String transitOrderId;//运单
    @Column(name = "transit_order_note_id")
    private String transitOrderNoteId;//节点

    @Column(name = "transport_no")
    private String transportNo;//运单号
    @Column(name = "contract_no")
    private String contractNo;//合同编号

    @Column(name = "receipt_no")
    private String receiptNo;//回单号

    @Column(name = "shipper_organize_name")
    private String shipperOrganizeName;//托运人/公司
    @Column(name = "rob_organize_name")
    private String robOrganizeName;//承运人单位 公司名称 所有人
    @Column(name = "transit_truck_no")
    private String transitTruckNo;//车牌号
    @Column(name = "transit_truck_user_name")
    private String transitTruckUserName;//驾驶员

    @Column(name = "delivery_name")
    private String deliveryName;//发货人
    @Column(name = "delivery_phone")
    private String deliveryPhone;//发货人电话
    @Column(name = "delivery_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deliveryTime;//发货时间
    @Column(name = "delivery_address")
    private String deliveryAddress;//发货地址

    @Column(name = "receipt_name")
    private String receiptName;//收货人
    @Column(name = "receipt_phone")
    private String receiptPhone;//收货人电话
    @Column(name = "receipt_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date receiptTime;//签收时间
    @Column(name = "receipt_address")
    private String receiptAddress;//收货地址

    //回执图片
    @Column(name = "receipt_img", columnDefinition = "TEXT")
    private String receiptImg;

    //签收人签字
    @Column(name = "receipt_sign_img")
    private String receiptSignImg;

    @Column(name = "receipt_tip")
    private String receiptTip = "本回单作为货物送达签收依据，并具有法律效力";

    /**
     * 查询字段  序列化结果
     */
    @Transient
    @TableField(exist = false)
    private List<TransitOrderNoteDetail> transitOrderNoteDetailList;//货物明细

    //回执单修复
    @Transient
    @TableField(exist = false)
    private Double totalDeliverMeasure;//节点发货量
    @Transient
    @TableField(exist = false)
    private Double totalReceiptMeasure;//节点收货量
    @Transient
    @TableField(exist = false)
    private String measureUnit;
    @Transient
    @TableField(exist = false)
    private String receiptSeal;

    public Double getTotalDeliverMeasure() {
        return totalDeliverMeasure;
    }

    public void setTotalDeliverMeasure(Double totalDeliverMeasure) {
        this.totalDeliverMeasure = totalDeliverMeasure;
    }

    public Double getTotalReceiptMeasure() {
        return totalReceiptMeasure;
    }

    public void setTotalReceiptMeasure(Double totalReceiptMeasure) {
        this.totalReceiptMeasure = totalReceiptMeasure;
    }

    public String getMeasureUnit() {
        return measureUnit;
    }

    public void setMeasureUnit(String measureUnit) {
        this.measureUnit = measureUnit;
    }

    public String getReceiptSeal() {
        return receiptSeal;
    }

    public void setReceiptSeal(String receiptSeal) {
        this.receiptSeal = receiptSeal;
    }

    public String getReceiptNo() {
        return receiptNo;
    }

    public void setReceiptNo(String receiptNo) {
        this.receiptNo = receiptNo;
    }

    public String getTransitTruckUserName() {
        return transitTruckUserName;
    }

    public void setTransitTruckUserName(String transitTruckUserName) {
        this.transitTruckUserName = transitTruckUserName;
    }

    public String getTransitOrderId() {
        return transitOrderId;
    }

    public void setTransitOrderId(String transitOrderId) {
        this.transitOrderId = transitOrderId;
    }

    public String getTransitOrderNoteId() {
        return transitOrderNoteId;
    }

    public void setTransitOrderNoteId(String transitOrderNoteId) {
        this.transitOrderNoteId = transitOrderNoteId;
    }

    public String getTransportNo() {
        return transportNo;
    }

    public void setTransportNo(String transportNo) {
        this.transportNo = transportNo;
    }

    public String getContractNo() {
        return contractNo;
    }

    public void setContractNo(String contractNo) {
        this.contractNo = contractNo;
    }

    public String getShipperOrganizeName() {
        return shipperOrganizeName;
    }

    public void setShipperOrganizeName(String shipperOrganizeName) {
        this.shipperOrganizeName = shipperOrganizeName;
    }

    public String getRobOrganizeName() {
        return robOrganizeName;
    }

    public void setRobOrganizeName(String robOrganizeName) {
        this.robOrganizeName = robOrganizeName;
    }

    public String getTransitTruckNo() {
        return transitTruckNo;
    }

    public void setTransitTruckNo(String transitTruckNo) {
        this.transitTruckNo = transitTruckNo;
    }

    public String getDeliveryName() {
        return deliveryName;
    }

    public void setDeliveryName(String deliveryName) {
        this.deliveryName = deliveryName;
    }

    public String getDeliveryPhone() {
        return deliveryPhone;
    }

    public void setDeliveryPhone(String deliveryPhone) {
        this.deliveryPhone = deliveryPhone;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public String getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(String deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public String getReceiptName() {
        return receiptName;
    }

    public void setReceiptName(String receiptName) {
        this.receiptName = receiptName;
    }

    public String getReceiptPhone() {
        return receiptPhone;
    }

    public void setReceiptPhone(String receiptPhone) {
        this.receiptPhone = receiptPhone;
    }

    public Date getReceiptTime() {
        return receiptTime;
    }

    public void setReceiptTime(Date receiptTime) {
        this.receiptTime = receiptTime;
    }

    public String getReceiptAddress() {
        return receiptAddress;
    }

    public void setReceiptAddress(String receiptAddress) {
        this.receiptAddress = receiptAddress;
    }

    public String getReceiptImg() {
        return receiptImg;
    }

    public void setReceiptImg(String receiptImg) {
        this.receiptImg = receiptImg;
    }

    public String getReceiptSignImg() {
        return receiptSignImg;
    }

    public void setReceiptSignImg(String receiptSignImg) {
        this.receiptSignImg = receiptSignImg;
    }

    public String getReceiptTip() {
        return receiptTip;
    }

    public void setReceiptTip(String receiptTip) {
        this.receiptTip = receiptTip;
    }

    public List<TransitOrderNoteDetail> getTransitOrderNoteDetailList() {
        return transitOrderNoteDetailList;
    }

    public void setTransitOrderNoteDetailList(List<TransitOrderNoteDetail> transitOrderNoteDetailList) {
        this.transitOrderNoteDetailList = transitOrderNoteDetailList;
    }
}
